<?php
class ucenter_api {

	public function __construct()
	{
		define('UC_OPEN', config_item('UC_OPEN','uc'));
		define('UC_CONNECT', config_item('UC_CONNECT','uc'));
		define('UC_DBHOST', config_item('UC_DBHOST','uc'));
		define('UC_DBUSER', config_item('UC_DBUSER','uc'));
		define('UC_DBPW', config_item('UC_DBPW','uc'));
		define('UC_DBNAME', config_item('UC_DBNAME','uc'));
		define('UC_DBCHARSET', config_item('UC_DBCHARSET','uc'));
		define('UC_DBTABLEPRE', config_item('UC_DBTABLEPRE','uc'));
		define('UC_DBCONNECT', config_item('UC_DBCONNECT','uc'));
		define('UC_CHARSET', config_item('UC_CHARSET','uc'));
		define('UC_KEY', config_item('UC_KEY','uc'));
		define('UC_API', config_item('UC_API','uc'));
		define('UC_APPID', config_item('UC_APPID','uc'));
		define('UC_IP', config_item('UC_IP','uc'));
		define('UC_PPP', config_item('UC_PPP','uc'));
		define('UC_DEBUG', config_item('UC_DEBUG','uc'));
		
		pimport('uc_client/client.php',BASEPATH);
	}

	public function __call($func, $args)
	{
		if( 'uc_' == substr($func, 0, 3) &&  function_exists($func) ){
			return call_user_func_array ( $func, $args);
		}
		log_message('error','Ucenter No method found '.$func);
	}
}
?>
